POV-Ray : Newsgroups : povray.general : Flower power : Re: Flower power Server Time
4 Aug 2024 02:23:47 EDT (-0400)
  Re: Flower power  
From: Mike Williams
Date: 23 Oct 2003 02:04:26
Message: <KwnOiDA022l$EwP5@econym.demon.co.uk>
Wasn't it Patrick Elliott who wrote:

>In my case I am trying to do something like:
>
>N = 5 * rnd
>vdelta = 2 * PI * rnd
>vector = a * sin(N * vdelta)
>X = cos(vector) * 30 
>Y = sin(vector) * 30
>
>The problem is all I get is a dang circle... It is driving me batty. If 
>it was for something in POV, it would be driving me even more nuts. But 
>man would the StarrRose make a real nice Isosurface. Sigh...

I think that N should be a constant (it's the number of petals or half
the number of petals depending on whether it's odd or even) and X and Y
should be cos(vdelta)*vector and sin(vdelta)*vector. "a" is a scaling
factor, the maximum radius of the whole shape

So:-

#version 3.5;
global_settings {assumed_gamma 1.0}
camera {location  <0,0,-10> look_at <0,0,0> angle 50}
background {rgb 1}
light_source {<-30, 100, -30> color rgb 1}

#declare rnd=0;
#declare N = 5;
#declare a=3;
#while (rnd < 1)
  #declare vdelta = 2 * pi * rnd;
  #declare vector = a * sin(N * vdelta);
  #declare X = cos(vdelta) * vector; 
  #declare Y = sin(vdelta) * vector;
    sphere {<X,Y,0>,0.2 pigment {rgb <1,1,0>}}
  #declare rnd = rnd + 0.001;
#end

If we bung the significant bit "vector = a * sin(N * vdelta)" into an
isosurface it looks like this "a * sin(N * f_th(x,z,y))", which doesn't
do anything useful on it's own but suggests something like this:-

#version 3.5;
global_settings {assumed_gamma 1.0}
camera { location  <-1, 1, -6> look_at <0, 0, 0> angle 50}
background {rgb 1}
light_source {<-30, 100, -30> color rgb 1}
#include "functions.inc"

#declare n = 5;
#declare a = 2;
isosurface {
  function { a * sin(n*f_th(x,z,y)) * f_sphere(x,y,z,a) + 0.1}
  max_gradient 20
  contained_by{sphere{0,a}}
  pigment {rgb .9}
  finish {phong 0.5 phong_size 10}
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.